package com.kay.restdemo.server.controller;

//import com.kay.restdemo.server.exception.MyException;
import com.kay.restdemo.server.domain.Student;
import org.springframework.web.bind.annotation.*;

@RestController
public class HelloWorld {
    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String printHello(){
        return "Hello World";
    }

//    @RequestMapping(value = "/errorjson")
//    public  String errorJson() throws MyException {
//        throw new MyException("获取json出现异常");
//    }

    /**
     *  bean 对象传参
     * @param student
     * @return
     */
    @PostMapping("/Student")
    public Object passStudent(@RequestBody Student student)
    {
        return student;
    }
}
